package com.jilefojing.dao.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.common.MySqlMapper;

import com.jilefojing.beans.enums.ItemTypeEnumForSource;
import com.jilefojing.beans.enums.ProgressStatusForSource;
import com.jilefojing.beans.enums.StatusEnumForPublish;
import com.jilefojing.beans.pojos.RCategorySource;
import com.jilefojing.beans.vo.Pagination;

/**
 * 
 * @author 作者 jgshun
 * @date 创建时间 2016年07月26日 16时40分30秒
 */
@Repository
public interface IRCategorySourceMapper extends Mapper<RCategorySource>, MySqlMapper<RCategorySource> {

	/**
	 * 统计并集类别条目的总数
	 * 
	 * @param intersectionCategoryConditions
	 * @param statuses
	 * @param returnItemTypes
	 * @param progressStatuses
	 * @return
	 */
	int countForIntersectionCategoryConditions(@Param("intersectionCategoryConditions") List<String> intersectionCategoryConditions, @Param("statuses") List<StatusEnumForPublish> statuses,
			@Param("returnItemTypes") List<ItemTypeEnumForSource> returnItemTypes, @Param("progressStatuses") List<ProgressStatusForSource> progressStatuses);

	/**
	 * 并集类别条目
	 * 
	 * @param intersectionCategoryConditions
	 * @param statuses
	 * @param returnItemTypes
	 * @param progressStatuses
	 * @param pagination
	 * @return
	 */
	List<RCategorySource> getListForIntersectionCategoryConditions(@Param("intersectionCategoryConditions") List<String> intersectionCategoryConditions,
			@Param("statuses") List<StatusEnumForPublish> statuses, @Param("returnItemTypes") List<ItemTypeEnumForSource> returnItemTypes,
			@Param("progressStatuses") List<ProgressStatusForSource> progressStatuses, @Param("pagination") Pagination<RCategorySource> pagination);

	/**
	 * 批量更新
	 * 
	 * @param categorySources
	 */
	void updateByIds(@Param("categorySources") List<RCategorySource> categorySources);

}